﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>注册页面</title>
</head>

<body style="font-family:Arial, Helvetica, sans-serif;">
<table align="center">
<form action="./reg.php" method="post">
<tr><td colspan="3"><img src="images/logo2.gif"></td></tr>
<tr><td colspan="3"><h2 align="center">欢迎您注册OX博客</h2></td></tr>
<tr><td width="120" align="right">用户名</td><td><input type="text" width="170" name="username"/></td><td id="unajax"></td></tr>
<tr><td width="120" align="right">密码</td><td><input type="password" width="170" name="password" id="pw1"/></td><td id="pwinfo" width="120"></td></tr>
<tr><td width="120" align="right">重复一遍密码</td><td><input type="password" width="170"id="pw2" onblur="checkpw()"/></td><td></td></tr>
<tr><td width="120" align="right">昵称</td><td><input type="text" width="170" name="nicheng"/></td><td></td></tr>
<tr><td width="120" align="right">性别</td><td><label><input type="radio" checked="checked" name="sex" value="m"/>男</label><label><input type="radio" name="sex" value="w"/>女</label>&nbsp;&nbsp;&nbsp;&nbsp;<span>年龄</span><input type="text" size="6" name="age"></td><td></td></tr>
<tr><td width="120" align="right">Email地址</td><td><input type="text" width="170" name="email"/></td><td></td></tr>
<tr><td width="120" align="right">QQ</td><td><input type="text" width="170" name="qq"/></td><td></td></tr>
<tr><td width="120" align="right">自我简介</td><td><textarea name="userinfo" cols="40" rows="6" style="background-image:url(./images/inputback.gif);">这家伙很懒什么也没留下......</textarea></td><td></td></tr>
<tr><td width="120" align="center"></td><td><input type="submit" value="注册" onclick="checkform()"/></td><td></td></tr>
</form>
</table>
</body>
</html>
<script>
var flag = false;
function checkpw()
{
	if(document.getElementById('pw1').value==document.getElementById('pw2').value)
	{
		document.getElementById('pwinfo').innerHTML = "√";
		flag = true;
	}else
	{
		document.getElementById('pwinfo').innerHTML= "两次输入不一致";
		flag = false;
	}
}
function checkform()
{
	
	if(flag)
	{	checkpw();
		if(document.all.username.value!=''&&document.all.password.value!='')
		{
			flag = true;
		}	
	}else
	{	checkpw();
		window.alert("请按要求输入!~!#~");
	}
	return flag;
}
</script>